import pymysql.constants.ER

n=int(input())
num=[]
for i in range(2,n+1):
   for j in range(2,i):
      if(i%j==0):
         break
   else:
      num.append(i)
print(num)


s=0
for i in num:
    s+=i
print(s)



